import {h,init} from 'snabbdom'

let patch = init([])

let vnode = h('div#container', [
  h('h1','hello sna'),
  h('p','p')
])

let app = document.querySelector('#app')

let oldVnode = patch(app,vnode)

setTimeout(() => {
  vnode = h('div#container', [
    h('h1','hello2 sna'),
    h('p','p2')
  ])
  patch(oldVnode,vnode)
  //清空页面元素
  patch(oldVnode, h('!'))
}, 2000);